package com.itjiange.reglg.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.itjiange.reglg.model.pojo.UserInfo;
import com.itjiange.reglg.model.vo.UserLoginVO;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * <p>
 * 用户登录
 * </p>
 *
 * @author ls
 * @since 2023-11-11
 */
public interface UserService extends IService<UserInfo> {

    /**
     * 利用用户名注册
     *
     * @param uuid
     * @param username
     * @param password
     * @param checkPassword
     * @param verCode
     * @return
     */
    boolean registerByUsername(String uuid,
                               String username,
                               String password,
                               String checkPassword,
                               String verCode);

    /**
     * 用户邮箱或手机号注册
     *
     * @param emailOrPhone
     * @param verCode
     * @return
     */
    boolean registerByEmailOrPhone(String emailOrPhone, String verCode);

    /**
     * 根据用户名登录
     *
     * @param captchaUUID
     * @param publicKeyUUID
     * @param username
     * @param password
     * @param verCode
     * @param request
     * @param response
     * @return
     */
    UserLoginVO loginByUsername(String captchaUUID,
                                String publicKeyUUID,
                                String username,
                                String password,
                                String verCode,
                                HttpServletRequest request,
                                HttpServletResponse response);

    /**
     * 根据邮箱或电话登录
     *
     * @param emailOrPhone
     * @param verCode
     * @param request
     * @return
     */
    UserLoginVO loginByEmailOrPhone(String emailOrPhone,
                                    String verCode,
                                    HttpServletRequest request);
}